package com.hfi.security.core.exception;

/**
 * @author ChangLiang
 * @date 2019/8/16
 */
public class SecurityCoreException extends RuntimeException {

    private ErrorCode errorCode;

    public SecurityCoreException(String msg) {
        super(msg);
    }

    public SecurityCoreException(String msg, Throwable e) {
        super(msg, e);
    }

    public SecurityCoreException(ErrorCode errorCode) {
        super(errorCode.memo);
        this.errorCode = errorCode;
    }

    public SecurityCoreException(ErrorCode errorCode,String msg) {
        super(errorCode.memo+":"+msg);
        this.errorCode = errorCode;
    }

    public ErrorCode getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(ErrorCode errorCode) {
        this.errorCode = errorCode;
    }
}
